﻿@using NewLife;
@using NewLife.Web;
@using XCode;
@using System.Linq;
@{
    var prefix = (Object)Model + "";
    var page = ViewBag.Page as Pager;

    var areaId = page[prefix + "AreaID"];

    var set = NewLife.Cube.CubeSetting.Current;
    var res = set.ResourceUrl;
    if (String.IsNullOrEmpty(res)) res = "/Content";
    res = res.TrimEnd('/');
}
<link href="@res/city_picker/city-picker.css" rel="stylesheet">
<div class="form-group" style="position:relative">
    <div>
        <input readonly type="text" id="@(prefix)AreaID" value="@areaId" data-toggle="city-picker" placeholder="请选择省/市/区" data-level="district" data-autoPost="false" data-perfix="@prefix">
    </div>
</div>
<script src="@res/city_picker/city-picker.js"></script>
<script>
    $.fn.citypicker.Constructor.DEFAULTS.dataUrl = '/Cube/AreaChilds?id=';
    $.fn.citypicker.Constructor.DEFAULTS.areaParents = '/Cube/AreaParents?id=';
</script>